import fa from "element-ui/src/locale/lang/fa";
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
import Login from '@/views/Login.vue'
import LayOut from '@/views/layout/LayOut.vue'
import local from '@/utils/local'
import store from '../store/index';
// 点击相同路由报错
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error => error)
}
export const asyncRoutes = [
  {
    path: "/",
    redirect: "/login",
    isshow: false
  },
  {
    path: "/login",
    component: Login,
    isshow: false
  },
  {
    path: "/home",
    component: LayOut,
    isshow: false
  },

  // 公共首页：图片暂用
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "imgHome",
        isshow: true,
        component: () => import('@/views/layout/imgHome/imgHome.vue'),
        meta: { title: "公共首页" }
      }
    ]
  },
  // 金融顾问首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "indexFrontManger",
        isshow: true,
        component: () => import('@/views/layout/home/Home.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 前台部门经理首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "indexFrontDepart",
        isshow: true,
        component: () => import('@/views/layout/departHome/departHome.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 信息部中心总监首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "infoCenterHome",
        isshow: true,
        component: () => import('@/views/layout/infoCenterHome/infoCenterHome.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 信息部部门首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "infoDepartHome",
        isshow: true,
        component: () => import('@/views/layout/infoDepartHome/infoDepartHome.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 客服部首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "custServiceHome",
        isshow: true,
        component: () => import('@/views/layout/custServiceHome/custServiceHome.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 前台中心总监首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "homeFrontCenter",
        isshow: true,
        component: () => import('@/views/layout/centerHome/centerHome.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 信贷房贷首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "backHome",
        isshow: true,
        component: () => import('@/views/layout/backHome/backHome.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 后台总监首页
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "backHome2",
        isshow: true,
        component: () => import('@/views/layout/backHome2/backHome2.vue'),
        meta: { title: "首页" }
      }
    ]
  },
  // 流转管理
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "circulationList",
        isshow: true,
        component: () => import('@/views/layout/circulationManagement/circulation/Circulation.vue'),
        meta: { title: "流转管理" }
      },
      {
        path: "cirDetails",
        meta: { title: "详情页" },
        isshow: false,
        component: () => import('@/views/layout/circulationManagement/CirDetails.vue')
      },
    ]
  },
  //签单管理
  {
    path: "/signManagement",
    component: LayOut,
    redirect: "signManagement/allSign",
    meta: { title: "签单管理" },
    isshow: true,
    children: [
      {
        path: "allSign",
        meta: { title: "所有签单",keepAlive: true  },
        isshow: true,
        component: () => import('@/views/layout/signManagement/allSign/AllSign.vue')
      },
      {
        path: "operationSign",
        meta: { title: "操作中签单" ,keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/signManagement/operationSign/OperationSign.vue')
      },
      {
        path: "loan",
        meta: { title: "放款签单",keepAlive: true  },
        isshow: true,
        component: () => import('@/views/layout/signManagement/loan/Loan.vue')
      },
      // 特殊单申请页面
      {
        path: "discount",
        meta: { title: "优惠单",keepAlive: true  },
        isshow: false,
        component: () => import('@/views/layout/signManagement/allSign/Discount.vue')
      },
      {
        path: "turn",
        meta: { title: "转单",keepAlive: true  },
        isshow: false,
        component: () => import('@/views/layout/signManagement/allSign/Turn.vue')
      },
      {
        path: "restart",
        meta: { title: "重启",keepAlive: true  },
        isshow: false,
        component: () => import('@/views/layout/signManagement/allSign/Restart.vue')
      },
      {
        path: "multBackstage",
        meta: { title: "多后台",keepAlive: true  },
        isshow: false,
        component: () => import('@/views/layout/signManagement/allSign/MultBackstage.vue')
      },
      {
        path: "transfeType",
        meta: { title: "转类型",keepAlive: true  },
        isshow: false,
        component: () => import('@/views/layout/signManagement/allSign/TransfeType.vue')
      },
      {
        path: "chargeBack",
        meta: { title: "退单",keepAlive: true  },
        isshow: false,
        component: () => import('@/views/layout/signManagement/allSign/ChargeBack.vue')
      },
      {
        path: "signDetails",
        meta: { title: "签单详情",keepAlive: true  },
        isshow: false,
        component: () => import('@/views/layout/signManagement/signDetails.vue')
      },
    ]
  },
  // 客户管理
  {
    path: "/custManagement",
    component: LayOut,
    redirect: "custManagement/custList",
    meta: { title: "客户管理" },
    isshow: true,
    children: [
      {
        path: "CustUnreadList",
        meta: { title: "未读客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustUnread/CustUnreadList.vue')
      },
      {
        path: "CustList",
        meta: { title: "所有客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustAll/CustList.vue')
      },
      {
        path: "CustCustomersList",
        meta: { title: "待分配客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustCustomers/CustCustomersList.vue')
      },
      {
        path: "CustreturnList",
        meta: { title: "回退客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustreturnList/CustreturnList.vue')
      },
      {
        path: "CustFocusList",
        meta: { title: "特别关注客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustFocus/CustFocusList.vue')
      },
      {
        path: "CustRecyclableList",
        meta: { title: "可回收客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustRecyclable/CustRecyclableList.vue')
      },
      {
        path: "CustSigningList",
        meta: { title: "签单客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustSigning/CustSigningList.vue')
      },
      {
        path: "CustUnplannedList",
        meta: { title: "未做计划客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CustUnplanned/CustUnplannedList.vue')
      },
      {
        path: "MergeCust",
        meta: { title: "合并客户",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/MergeCust/MergeCust.vue')
      },
      {
        path: "CallLog",
        meta: { title: "通话记录",keepAlive: true },
        isshow: true,
        component: () => import('@/views/layout/custManagement/CallLog/callLog.vue')
      },
      {
        path: "call",
        isshow: true,
        component: () => import('@/views/layout/custManagement/call/call.vue'),
        meta: { title: "拨打电话",keepAlive: true }
      },
      {
        path: "createPlan",
        meta: { title: "新建计划",keepAlive: true },
        isshow: false,
        component: () => import('@/views/layout/custManagement/CreatePlan.vue')
      },
      {
        path: "createSign",
        meta: { title: "新建签单",keepAlive: true },
        isshow: false,
        component: () => import('@/views/layout/custManagement/CreateSign.vue')
      },
      {
        path: "custDetails",
        meta: { title: "客户详情",keepAlive: true },
        isshow: false,
        component: () => import('@/views/layout/custManagement/CustDetails.vue')
      },
      {
        path: "circulationList",
        isshow: true,
        component: () => import('@/views/layout/circulationManagement/circulation/Circulation.vue'),
        meta: { title: "流转管理",keepAlive: true }
      },
      {
        path: "cirDetails",
        meta: { title: "流转情页",keepAlive: true },
        isshow: false,
        component: () => import('@/views/layout/circulationManagement/CirDetails.vue')
      },
    ]
  },
  // 分配管理
  {
    path: "/distribution",
    component: LayOut,
    redirect: "distribution/normalRecord-list",
    meta: { title: "分配管理" },
    isshow: true,
    children: [
      {
        path: "normalRecord-list",
        meta: { title: "正常记录" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/distribution/normalList')
      },
      {
        path: "deleteRecord-list",
        meta: { title: "删除记录" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/distribution/deleteList')
      },
      {
        path: "CustAssignList",
        meta: { title: "分配客户" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/distribution/CustAssignList.vue')
      },
      {
        path: "CustNotConnectedList",
        meta: { title: "未接来电客户" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/distribution/CustNotConnectedList.vue')
      },
    ]
  },
  // 计划管理
  {
    path: "/plan",
    component: LayOut,
    redirect: "plan/all-list",
    meta: { title: "计划管理" },
    isshow: true,
    children: [
      {
        path: "overdue-list",
        meta: { title: "过期计划" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/planManagement/overdue/overdueList')
      },
      {
        path: "wait-list",
        meta: { title: "待完成计划" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/planManagement/wait/waitList')
      },
      {
        path: "nofinish-list",
        meta: { title: "未完成计划" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/planManagement/nofinish/nofinishList')
      },
      {
        path: "all-list",
        meta: { title: "所有计划" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/planManagement/all/allList')
      },
    ]
  },
  // 目标管理
  {
    path: "/target",
    component: LayOut,
    redirect: "target/personTarget-list",
    meta: { title: "目标管理" },
    isshow: true,
    children: [
      {
        path: "departmentTarget-list",
        meta: { title: "部门目标" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/targetManagement/departmentTarget')
      },
      {
        path: "personTarget-list",
        meta: { title: "个人目标" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/targetManagement/personTarget')
      },
      {
        path: "newTargets",
        meta: { title: "新建目标" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/targetManagement/newTargets')
      },
    ]
  },
  // 设置
  {
    path: "/setup",
    component: LayOut,
    redirect: "setup/duty-list",
    meta: { title: "设置" },
    isshow: true,
    children: [
      {
        path: "duty-list",
        meta: { title: "值班设置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/DutyList')
      },
      {
        path: "system-list",
        meta: { title: "系统设置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/System')
      },
      {
        path: "userManagement",
        meta: { title: "用户管理" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/UserManagement/userList'),
      },
      {
        path: "rolesManagement",
        meta: { title: "角色管理" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/RolesManagement/roleList'),
      },
      {
        path: "orgList",
        meta: { title: "部门管理" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/OrgManagement/orgList.vue'),
      },
      {
        path: "JuridsictionList",
        meta: { title: "权限管理" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/Jurisdiction/JuridsictionList.vue'),
      },
      {
        path: "dataSources",
        meta: { title: "数据来源设置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/DataSources/dataSources.vue'),
      },
      {
        path: "financialCategory",
        meta: { title: "财务类别设置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/FinancialCategory/financialCategory.vue'),
      },
      {
        path: "feeName",
        meta: { title: "费用名称配置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/FeeName/feeName.vue'),
      },
      {
        path: "blackList",
        meta: { title: "黑名单设置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/BlackList/blackList'),
      },
      {
        path: "staffManagement",
        meta: { title: "协议管理员管理部门" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/StaffManagement/staffManagement'),
      },
      {
        path: "archivesManagement",
        meta: { title: "档案管理员管理部门" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/ArchivesManagement/archivesManagement'),
      },
      {
        path: "cashierManagement",
        meta: { title: "出纳管理部门" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/CashierManagement/cashierManagement'),
      },
      {
        path: "alertSet",
        meta: { title: "预警设置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/alertSet/alertSet'),
      },
      {
        path: "missedCallAssignment",
        meta: { title: "未接电话分配设置" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/setup/MissedCallAssignment/MissedCallAssignment.vue'),
      },
    ]
  },
  // 渠道维护
  {
    path: "",
    component: LayOut,
    isshow: true,
    children: [
      {
        path: "channelMaintain",
        meta: { title: "渠道维护" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/channelMaintain/maintainList')
      },
    ],
  },
  //费用收入与支出管理
  {
    path: "/incomeORexpend",
    component: LayOut,
    isshow: true,
    redirect: "incomeORexpend/AgencyFee",
    meta: { title: "费用收入与支出管理" },
    children: [
      {
        path: "Deposit",
        isshow: true,
        component: () => import('@/views/layout/incomeORexpend/Deposit.vue'),
        meta: { title: "定金" }
      },

    ]
  },

  //中介返佣单
  {
    path: "/AgencyFee",
    component: LayOut,
    isshow: true,
    redirect: "AgencyFee/agencyFee",
    meta: { title: "中介返佣单" },
    children: [
      {
        path: "allFee",
        isshow: true,
        component: () => import('@/views/layout/AgencyFee/allFee.vue'),
        meta: { title: "所有返佣单" ,keepAlive: true}
      },
      {
        path: "unFee",
        isshow: true,
        component: () => import('@/views/layout/AgencyFee/unFee.vue'),
        meta: { title: "未返佣" ,keepAlive: true}
      },
      {
        path: "alerdyFee",
        isshow: true,
        component: () => import('@/views/layout/AgencyFee/alerdyFee.vue'),
        meta: { title: "已返佣" ,keepAlive: true}
      },
      {
        path: "print",
        isshow: true,
        component: () => import('@/views/layout/AgencyFee/print.vue'),
        meta: { title: "打印" ,keepAlive: true}
      },
    ]
  },

  //服务费
  {
    path: "/ServiceCharge",
    component: LayOut,
    isshow: true,
    redirect: "ServiceCharge/allService",
    meta: { title: "服务费" },
    children: [
      {
        path: "allService",
        isshow: true,
        component: () => import('@/views/layout/ServiceCharge/allService.vue'),
        meta: { title: "所有服务费" ,keepAlive: true}
      },
      {
        path: "unService",
        isshow: true,
        component: () => import('@/views/layout/ServiceCharge/unService.vue'),
        meta: { title: "未收取服务费" ,keepAlive: true}
      },
      {
        path: "alerdyService",
        isshow: true,
        component: () => import('@/views/layout/ServiceCharge/alerdyService.vue'),
        meta: { title: "已收取服务费" ,keepAlive: true}
      },
      {
        path: "detailsPage",
        isshow: false,
        component: () => import('@/views/layout/ServiceCharge/detailsPage.vue'),
        meta: { title: "服务费详情" ,keepAlive: true}
      },
      {
        path: "printPage1",
        isshow: false,
        component: () => import('@/views/layout/ServiceCharge/printPage1.vue'),
        meta: { title: "打印服务费" ,keepAlive: true}
      },
      {
        path: "printPage2",
        isshow: false,
        component: () => import('@/views/layout/ServiceCharge/printPage2.vue'),
        meta: { title: "打印凭证" ,keepAlive: true}
      },
    ]
  },

  //其他费用
  {
    path: "/OtherFee",
    component: LayOut,
    isshow: true,
    redirect: "OtherFee/otherFee",
    meta: { title: "其他费用" },
    children: [
      {
        path: "otherFee",
        isshow: true,
        component: () => import('@/views/layout/OtherFee/OtherFee.vue'),
        meta: { title: "其他费用" ,keepAlive: true}
      },
      {
        path: "OtherFeePrint", //营销部
        isshow: true,
        component: () => import('@/views/layout/OtherFee/OtherFeePrint.vue'),
        meta: { title: "其他费用收取" ,keepAlive: true}
      },
      {
        path: "OtherFeePrint2", //渠道部
        isshow: true,
        component: () => import('@/views/layout/OtherFee/OtherFeePrint2.vue'),
        meta: { title: "其他费用收取" ,keepAlive: true}
      },
    ]
  },

  //档案管理
  {
    path: "",
    component: LayOut,
    isshow: true,
    meta: { title: "档案管理" },
    children: [
      {
        path: "archivesManagement",
        isshow: true,
        component: () => import('@/views/layout/archivesManagement/archivesManagement.vue'),
        meta: { title: "档案管理" ,keepAlive: true}
      },
      {
        path: "/ArchivesManagementDetails",
        isshow: true,
        component: () => import('@/views/layout/archivesManagement/ArchivesManagementDetails.vue'),
        meta: { title: "档案详情" ,keepAlive: true}
      },
      {
        path: "/AddarchivesManagement",
        isshow: true,
        component: () => import('@/views/layout/archivesManagement/AddarchivesManagement.vue'),
        meta: { title: "档案新增" ,keepAlive: true}
      },
      {
        path: "/editarchivesManagement",
        isshow: true,
        component: () => import('@/views/layout/archivesManagement/editarchivesManagement.vue'),
        meta: { title: "档案编辑" ,keepAlive: true}
      },
    ]
  },
  //渠道管理
  {
    path: "/channelManagements",
    component: LayOut,
    redirect: "channelManagements/ChanManagement",
    isshow: true,
    meta: { title: "渠道管理" },
    children: [
      {
        path: "AllChan",
        isshow: true,
        component: () => import('@/views/layout/channelManagements/AllChan.vue'),
        meta: { title: "所有渠道" ,keepAlive: true}
      },
      {
        path: "InoperChan",
        isshow: true,
        component: () => import('@/views/layout/channelManagements/InoperChan.vue'),
        meta: { title: "操作中渠道" ,keepAlive: true}
      },
      {
        path: "OverChan",
        isshow: true,
        component: () => import('@/views/layout/channelManagements/OverChan.vue'),
        meta: { title: "过件中渠道" ,keepAlive: true}
      },
      {
        path: "LoanChan",
        isshow: true,
        component: () => import('@/views/layout/channelManagements/LoanChan.vue'),
        meta: { title: "放款渠道" ,keepAlive: true}
      },
      {
        path: "CloseChan",
        isshow: true,
        component: () => import('@/views/layout/channelManagements/CloseChan.vue'),
        meta: { title: "关闭渠道" ,keepAlive: true}
      },
    ]
  },
  //审核管理
  {
    path: "/auditMannagement",
    component: LayOut,
    redirect: "auditMannagement/Tobereviewed",
    isshow: true,
    meta: { title: "审核管理" },
    children: [
      {
        path: "Reviewed",
        isshow: true,
        component: () => import('@/views/layout/auditMannagement/Reviewed.vue'),
        meta: { title: "已审核",keepAlive: true }
      },
      {
        path: "Tobereviewed",
        isshow: true,
        component: () => import('@/views/layout/auditMannagement/Tobereviewed.vue'),
        meta: { title: "待审核",keepAlive: true }
      },
      /**====================申请管理===================== */
      {
        path: "apply-list",
        meta: { title: "申请管理",keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/applyManagement/applyList')
      },
      {
        path: "applyDetails",
        meta: { title: "申请详情",keepAlive: true },
        isshow: false,
        component: () => import('@/views/layout/applyManagement/applyDetails')
      },
    ]
  },
  //签单分配
  {
    path: "/signDistribution",
    component: LayOut,
    redirect: "signDistribution/Allorder",
    isshow: true,
    meta: { title: "签单分配" },
    children: [
      {
        path: "InimpOrder",
        isshow: true,
        component: () => import('@/views/layout/signDistribution/InimpOrder.vue'),
        meta: { title: "已分配签单" ,keepAlive: true}
      },
      {
        path: "UnimpOrder",
        isshow: true,
        component: () => import('@/views/layout/signDistribution/UnimpOrder.vue'),
        meta: { title: "待分配签单" ,keepAlive: true}
      },
      {
        path: "SpecialUnimpOrder",
        isshow: true,
        component: () => import('@/views/layout/signDistribution/SpecialUnimpOrder.vue'),
        meta: { title: "待分配特殊流程签单" ,keepAlive: true}
      },

    ]
  },
  //接单管理
  {
    path: "/reorderManagement",
    component: LayOut,
    redirect: "reorderManagement/UnimpOrder",
    isshow: true,
    meta: { title: "接单管理" },
    children: [
      {
        path: "Allorder",
        isshow: true,
        component: () => import('@/views/layout/reOrderManagement/Allorder.vue'),
        meta: { title: "所有接单" ,keepAlive: true}
      },
      {
        path: "UnimpOrder",
        isshow: true,
        component: () => import('@/views/layout/reOrderManagement/UnimpOrder.vue'),
        meta: { title: "待落实接单" ,keepAlive: true}
      },
      {
        path: "InimpOrder",
        isshow: true,
        component: () => import('@/views/layout/reOrderManagement/InimpOrder.vue'),
        meta: { title: "已落实接单" ,keepAlive: true}
      },

    ]
  },
  //流程管理
  {
    path: "",
    component: LayOut,
    isshow: true,
    meta: { title: "流程管理" },
    children: [
      {
        path: "techProcessManagement",
        isshow: true,
        component: () => import('@/views/layout/techProcessManagement/TechProcessManagement.vue'),
        meta: { title: "流程管理" ,keepAlive: true}
      },
    ]
  },
  //查询管理
  {
    path: "/searchManagement",
    component: LayOut,
    redirect: "searchManagement/ReorderSearch",
    isshow: true,
    meta: { title: "查询管理" },
    children: [
      {
        path: "ReorderSearch",
        isshow: true,
        component: () => import('@/views/layout/searchManagement/ReorderSearch.vue'),
        meta: { title: "签单查询" ,keepAlive: true}
      },
      {
        path: "CustomerSearch",
        isshow: true,
        component: () => import('@/views/layout/searchManagement/CustomerSearch.vue'),
        meta: { title: "客户查询" ,keepAlive: true}
      },
      {
        path: "CheckOutSearch",
        isshow: true,
        component: () => import('@/views/layout/searchManagement/CheckOutSearch.vue'),
        meta: { title: "结账查询" ,keepAlive: true}
      },
      {
        path: "ReturnInformation",
        isshow: true,
        component: () => import('@/views/layout/searchManagement/ReturnInformation.vue'),
        meta: { title: "退信息部待审核" ,keepAlive: true}
      },
      {
        path: "ImportList",
        isshow: true,
        component: () => import('@/views/layout/searchManagement/ImportList.vue'),
        meta: { title: "导入未分配" ,keepAlive: true}
      },
      {
        path: "ReturnArchives",
        isshow: true,
        component: () => import('@/views/layout/searchManagement/ReturnArchives.vue'),
        meta: { title: "退信息部档案" ,keepAlive: true}
      },
      {
        path: "searchDetails",
        isshow: false,
        component: () => import('@/views/layout/searchManagement/searchDetails.vue'),
        meta: { title: "详情" ,keepAlive: true}
      },
    ]
  },
  //邮件管理
  {
    path: "/emailManagement",
    component: LayOut,
    redirect: "emailManagement/emailAccount",
    isshow: true,
    meta: { title: "邮件管理" },
    children: [
      {
        path: "emailAccount",
        isshow: true,
        component: () => import('@/views/layout/emailManagement/EmailAccount.vue'),
        meta: { title: "邮件账号管理" ,keepAlive: true}
      },
      {
        path: "emailTemplate",
        isshow: true,
        component: () => import('@/views/layout/emailManagement/EmailTemplate.vue'),
        meta: { title: "邮件模板管理" ,keepAlive: true}
      }
    ]
  },
  //费用管理
  {
    path: "/costManagement",
    component: LayOut,
    redirect: "costManagement/UnsubmitFee",
    isshow: true,
    meta: { title: "后台费用管理" },
    children: [
      {
        path: "Allfee",
        isshow: true,
        component: () => import('@/views/layout/costManagement/Allfee.vue'),
        meta: { title: "所有费用" ,keepAlive: true}
      },
      {
        path: "PrintFee",
        isshow: true,
        component: () => import('@/views/layout/costManagement/PrintFee.vue'),
        meta: { title: "费用报销打印" ,keepAlive: true}
      },
      {
        path: "ReimbursFee",
        isshow: true,
        component: () => import('@/views/layout/costManagement/ReimbursFee.vue'),
        meta: { title: "待报销费用" ,keepAlive: true}
      },
      {
        path: "ReviewedFee",
        isshow: true,
        component: () => import('@/views/layout/costManagement/ReviewedFee.vue'),
        meta: { title: "已审核费用" ,keepAlive: true}
      },
      {
        path: "ReviewFee",
        isshow: true,
        component: () => import('@/views/layout/costManagement/ReviewFee.vue'),
        meta: { title: "待审核费用" ,keepAlive: true}
      },
      {
        path: "ReimbursedFee",
        isshow: true,
        component: () => import('@/views/layout/costManagement/ReimbursedFee.vue'),
        meta: { title: "已报销费用" ,keepAlive: true}
      },
      {
        path: "UnsubmitFee",
        isshow: true,
        component: () => import('@/views/layout/costManagement/UnsubmitFee.vue'),
        meta: { title: "待提交费用" ,keepAlive: true}
      },
    ]
  },
  //前后台结账
  {
    path: "",
    component: LayOut,
    isshow: true,
    meta: { title: "前后台结账" },
    children: [
      {
        path: "frontORrear",
        isshow: true,
        component: () => import('@/views/layout/frontORrear/FrontORrear.vue'),
        meta: { title: "前后台结账" ,keepAlive: true}
      },
    ]
  },
  //返佣管理
  {
    path: "/returnManagement",
    component: LayOut,
    redirect: "returnManagement/StayReturnComiss",
    isshow: true,
    meta: { title: "渠道返佣" },
    children: [
      {
        path: "StayReturnComiss",
        isshow: true,
        component: () => import('@/views/layout/returnManagement/StayReturnComiss.vue'),
        meta: { title: "待返佣" ,keepAlive: true}
      },
      {
        path: "ReturnedComiss",
        isshow: true,
        component: () => import('@/views/layout/returnManagement/ReturnedComiss.vue'),
        meta: { title: "已返佣" ,keepAlive: true}
      },
    ]
  },
  //后台渠道返佣
  {
    path: "/backStageChannalComiss",
    component: LayOut,
    redirect: "backStageChannalComiss/backStageChannalComiss",
    isshow: true,
    meta: { title: "后台渠道返佣" },
    children: [
      {
        path: "backStageChannalComiss",
        isshow: true,
        component: () => import('@/views/layout/backStageChannalComiss/backStageChannalComiss.vue'),
        meta: { title: "后台渠道返佣" ,keepAlive: true}
      },
      {
        path: "backStageChannalComissOrder",
        isshow: true,
        component: () => import('@/views/layout/backStageChannalComiss/backStageChannalComissOrder.vue'),
        meta: { title: "后台渠道返佣认领单" ,keepAlive: true}
      },
      {
        path: "Confis",
        isshow: true,
        component: () => import('@/views/layout/backStageChannalComiss/Confis.vue'),
        meta: { title: "充公单" ,keepAlive: true}
      },
      {
        path: "ConfisPrint",
        isshow: true,
        component: () => import('@/views/layout/backStageChannalComiss/ConfisPrint.vue'),
        meta: { title: "渠道返佣充公单" ,keepAlive: true}
      },
      {
        path: "OrderPrint",
        isshow: true,
        component: () => import('@/views/layout/backStageChannalComiss/OrderPrint.vue'),
        meta: { title: "渠道返佣认领单" ,keepAlive: true}
      },
    ]
  },

  //结账单管理
  {
    path: "/statementManagement",
    component: LayOut,
    redirect: "statementManagement/allSign",
    meta: { title: "结账单管理" },
    isshow: true,
    children: [
      {
        path: "allSign",
        meta: { title: "所有签单" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/statementManagement/allSign')
      },
      {
        path: "allStatement",
        meta: { title: "已处理结账单" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/statementManagement/allStatement')
      },
      {
        path: "unStatement",
        meta: { title: "未处理结账单" ,keepAlive: true},
        isshow: true,
        component: () => import('@/views/layout/statementManagement/unStatement')
      },
      {
        path: "signDetails",
        meta: { title: "签单详情" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/signDetails')
      },
      // 特殊单申请页面
      {
        path: "discount",
        meta: { title: "优惠单" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/specialForm/Discount')
      },
      {
        path: "turn",
        meta: { title: "转单" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/specialForm/Turn')
      },
      {
        path: "restart",
        meta: { title: "重启" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/specialForm/Restart')
      },
      {
        path: "multBackstage",
        meta: { title: "多后台" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/specialForm/MultBackstage')
      },
      {
        path: "transfeType",
        meta: { title: "转类型" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/specialForm/TransfeType')
      },
      {
        path: "report",
        meta: { title: "报备单" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/specialForm/Restart')
      },
      {
        path: "chargeBack",
        meta: { title: "退单" ,keepAlive: true},
        isshow: false,
        component: () => import('@/views/layout/statementManagement/specialForm/ChargeBack')
      },
      {
        path: "statementDetail",
        meta: { title: "结账单详情",keepAlive: true },
        isshow: false,
        component: () => import('@/views/layout/statementManagement/statementDetail')
      },
    ]
  },
  {
    path: "/expense",
    component: LayOut,
    isshow: true,
    redirect: "expense/expenseReimbursement",
    meta: { title: "费用报销管理" },
    children: [
      {
        path: "expenseReimbursement",
        isshow: true,
        component: () => import('@/views/layout/ExpenseReimbursement/expenseReimbursement.vue'),
        meta: { title: "待报销" ,keepAlive: true}
      },
      {
        path: "list1",
        isshow: true,
        component: () => import('@/views/layout/ExpenseReimbursement/list1.vue'),
        meta: { title: "已报销" ,keepAlive: true}
      },
      {
        path: "list2",
        isshow: true,
        component: () => import('@/views/layout/ExpenseReimbursement/list2.vue'),
        meta: { title: "已作废" ,keepAlive: true}
      },
      {
        path: "list3",
        isshow: true,
        component: () => import('@/views/layout/ExpenseReimbursement/list3.vue'),
        meta: { title: "报销审批" ,keepAlive: true}
      },
      {
        path: "allExpense",
        isshow: true,
        component: () => import('@/views/layout/ExpenseReimbursement/allExpense.vue'),
        meta: { title: "所有报销" ,keepAlive: true}
      },
      {
        path: "expenseDetails",
        isshow: false,
        component: () => import('@/views/layout/ExpenseReimbursement/expenseDetails.vue'),
        meta: { title: "费用报销详情" ,keepAlive: true}
      },
      {
        path: "printPage",
        isshow: false,
        component: () => import('@/views/layout/ExpenseReimbursement/printPage.vue'),
        meta: { title: "费用报销打印" ,keepAlive: true}
      },
    ]
  },
  {
    path: "",
    component: LayOut,
    isshow: true,
    meta: { title: "其他费用（出纳）" },
    children: [
      {
        path: "/otherExpenses",
        isshow: true,
        component: () => import('@/views/layout/otherExpenses/otherExpenses.vue'),
        meta: { title: "其他费用（出纳）" }
      },
      {
        path: "otherExpensesDetails",
        isshow: false,
        component: () => import('@/views/layout/otherExpenses/otherExpensesDetails.vue'),
        meta: { title: "其他费用详情" }
      },
    ]
  },
  {
    path: "",
    component: LayOut,
    isshow: true,
    meta: { title: "测试" },
    children: [
      {
        path: "baidu",
        isshow: true,
        component: () => import('@/views/layout/Baidu/baidu.vue'),
        meta: { title: "测试" }
      },
    ]
  },
  {
    path: "/error",
    component: () => import('@/views/layout/Error404.vue')
  },
  {
    path: "*",
    isshow: false,
    redirect: '/error',
  },
  //统计管理
  {
    path: "/totalManagement",
    component: LayOut,
    redirect: "totalManagement/DistrubutionNumTotal",
    isshow: true,
    meta: { title: "统计管理" },
    children: [
      {
        path: "DistrubutionNumTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/DistrubutionNumTotal.vue'),
        meta: { title: "分配数量统计" ,keepAlive: true}
      },
      {
        path: "PhonefeedbackTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/PhonefeedbackTotal.vue'),
        meta: { title: "首电反馈统计" ,keepAlive: true}
      },
      {
        path: "SourcTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/SourcTotal.vue'),
        meta: { title: "数据来源统计" ,keepAlive: true}
      },
      {
        path: "CallOutTotald",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/CallOutTotald.vue'),
        meta: { title: "电话呼出统计" ,keepAlive: true}
      },
      {
        path: "SignSourceTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/SignSourceTotal.vue'),
        meta: { title: "签单来源统计" ,keepAlive: true}
      },
      {
        path: "SignNumTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/SignNumTotal.vue'),
        meta: { title: "签单笔数统计" ,keepAlive: true}
      },
      {
        path: "PhoneTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/PhoneTotal.vue'),
        meta: { title: "电话量统计" ,keepAlive: true}
      },
      {
        path: "PlanTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/PlanTotal.vue'),
        meta: { title: "计划统计" ,keepAlive: true}
      },
      {
        path: "PlanTypeTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/PlanTypeTotal.vue'),
        meta: { title: "计划类型统计" ,keepAlive: true}
      },
      {
        path: "SignTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/SignTotal.vue'),
        meta: { title: "签单统计" ,keepAlive: true}
      },
      {
        path: "SignStateTotal",
        isshow: true,
        component: () => import('@/views/layout/totalManagement/SignStateTotal.vue'),
        meta: { title: "签单状态统计" ,keepAlive: true}
      }
    ]
  },
  //定金
  {
    path: "/Deposit",
    component: LayOut,
    redirect: "Deposit/depositReceived",
    isshow: true,
    meta: { title: "定金" },
    children: [
      {
        path: "allDepositPrint",
        isshow: true,
        component: () => import('@/views/layout/Deposit/allDepositPrint.vue'),
        meta: { title: "所有定金" ,keepAlive: true}
      },
      {
        path: "depositReceived",
        isshow: true,
        component: () => import('@/views/layout/Deposit/depositReceived.vue'),
        meta: { title: "已收取定金" ,keepAlive: true}
      },
      {
        path: "noDeposit",
        isshow: true,
        component: () => import('@/views/layout/Deposit/noDeposit.vue'),
        meta: { title: "未收取定金" ,keepAlive: true}
      },
      {
        path: "revenueQuery",
        isshow: true,
        component: () => import('@/views/layout/Deposit/revenueQuery.vue'),
        meta: { title: "转收入记录" ,keepAlive: true}
      },
      {
        path: "DepositPrint",
        isshow: true,
        component: () => import('@/views/layout/Deposit/DepositPrint.vue'),
        meta: { title: "定金转收入调账说明" ,keepAlive: true}
      },
      {
        path: "DepositPrint2",
        isshow: false,
        component: () => import('@/views/layout/Deposit/DepositPrint2.vue'),
        meta: { title: "已收定金调账说明"}
      },
    ]
  },
  //原件借出
  {
    path: "/oriManagement",
    component: LayOut,
    redirect: "oriManagement/lend",
    isshow: true,
    meta: { title: "原件管理" },
    children: [
      {
        path: "lend",
        isshow: true,
        component: () => import('@/views/layout/oriManagement/lend.vue'),
        meta: { title: "原件借出" ,keepAlive: true}
      },
      {
        path: "lendingHistory",
        isshow: true,
        component: () => import('@/views/layout/oriManagement/lendingHistory.vue'),
        meta: { title: "借出历史" ,keepAlive: true}
      },
      {
        path: "originalManagementDetails",
        isshow: false,
        component: () => import('@/views/layout/oriManagement/OriginalManagementDetails.vue'),
        meta: { title: "原件详情" ,keepAlive: true}
      },
      {
        path: "OriginalManagementDetailscopy",
        isshow: false,
        component: () => import('@/views/layout/oriManagement/OriginalManagementDetailscopy.vue'),
        meta: { title: "原件详情" ,keepAlive: true}
      },
      {
        path: "originallend",
        isshow: false,
        component: () => import('@/views/layout/oriManagement/OriginalLend.vue'),
        meta: { title: "原件借出" ,keepAlive: true}
      },
      {
        path: "originalreturn",
        isshow: false,
        component: () => import('@/views/layout/oriManagement/OriginalReturn.vue'),
        meta: { title: "原件归还" ,keepAlive: true}
      },
      {
        path: "addOriginal",
        isshow: false,
        component: () => import('@/views/layout/oriManagement/AddOriginal.vue'),
        meta: { title: "原件新增" ,keepAlive: true}
      },
      {
        path: "OriginalCollection",
        isshow: false,
        component: () => import('@/views/layout/oriManagement/OriginalCollection.vue'),
        meta: { title: "原件收录" ,keepAlive: true}
      },
    ]
  },
  // 退费单管理
  {
    path: "/refundManagement",
    component: LayOut,
    redirect: "refundManagement/refundManagement",
    isshow: true,
    meta: { title: "退费单管理" },
    children: [
      {
        path: "refundManagement",
        isshow: true,
        component: () => import('@/views/layout/refundManagement/refundManagement'),
        meta: { title: "创建退费单",keepAlive: true }
      },
      {
        path: "createList",
        isshow: false,
        component: () => import('@/views/layout/refundManagement/createList'),
        meta: { title: "退单详情" ,keepAlive: true}
      },
      {
        path: "refundList",
        isshow: true,
        component: () => import('@/views/layout/refundManagement/refundList'),
        meta: { title: "所有退费单" ,keepAlive: true}
      },
      {
        path: "printPage",
        isshow: true,
        component: () => import('@/views/layout/refundManagement/printPage'),
        meta: { title: "退费单打印" ,keepAlive: true}
      },
    ]
  },
  {
    path: "/record",
    component: LayOut,
    isshow: true,
    meta: { title: "分配记录" },
    children: [
      {
        path: "alocationRecord",
        isshow: true,
        component: () => import('@/views/layout/alocationRecord/alocationRecord.vue'),
        meta: { title: "分配记录" ,keepAlive: true}
      },
      {
        path: "alocationCust",
        isshow: true,
        component: () => import('@/views/layout/alocationRecord/alocationCust.vue'),
        meta: { title: "分配列表" ,keepAlive: true}
      },
    ]
  },
  {
    path: "/record",
    component: LayOut,
    isshow: true,
    meta: { title: "回收记录" },
    children: [
      {
        path: "recoveryRecord",
        isshow: true,
        component: () => import('@/views/layout/recoveryRecord/recoveryRecord.vue'),
        meta: { title: "回收记录" ,keepAlive: true}
      },
      {
        path: "recoveryCust",
        isshow: true,
        component: () => import('@/views/layout/recoveryRecord/recoveryCust.vue'),
        meta: { title: "回收列表" ,keepAlive: true}
      },
    ]
  },
  // 统计
  {
    path: "/Statistics",
    component: LayOut,
    redirect: "Statistics/Unassigned",
    isshow: true,
    meta: { title: "统计" },
    children: [
      {
        path: "Unassigned",
        isshow: true,
        component: () => import('@/views/layout/Statistics/Unassigned/Unassigned.vue'),
        meta: { title: "未分配统计" ,keepAlive: true}
      },
      {
        path: "DepartmentCustomer",
        isshow: false,
        component: () => import('@/views/layout/Statistics/DepartmentCustomer/DepartmentCustomer.vue'),
        meta: { title: "部门客户统计" ,keepAlive: true}
      },
      {
        path: "Customer",
        isshow: true,
        component: () => import('@/views/layout/Statistics/Customer/Customer.vue'),
        meta: { title: "客户管理统计" ,keepAlive: true}
      },

    ]
  },
]

const router = new VueRouter({
  routes: asyncRoutes
})
router.beforeEach((to, from, next) => {
  let binding = sessionStorage.getItem("binding");
  if (to.path == "/login") {
    next()
  } else if (binding) {
    next()
  } else {
    router.push("/login")
  }
});
export default router
